if ( $this->mTitle->isCascadeProtected() ) {
# Is this page under cascading protection from some source pages?
list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
- $notice = "";
- foreach( $cascadeSources as $page ) {
- $notice .= '* [[:' . $page->getPrefixedText() . "]]\n";
+ $notice = "$1\n";
+ if ( count($cascadeSources) > 0 ) {
+ # Explain, and list the titles responsible
+ foreach( $cascadeSources as $page ) {
+ $notice .= '* [[:' . $page->getPrefixedText() . "]]\n";
+ }
}
- $wgOut->addWikiMsg( 'cascadeprotectedwarning', count($cascadeSources), $notice );
+ $wgOut->wrapWikiMsg( $notice, array( 'cascadeprotectedwarning', count($cascadeSources) ) );
}
if( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) != array() ){
$wgOut->addWikiMsg( 'titleprotectedwarning' );
You may wish to cut-n-paste the text into a text file and save it for later.</strong>',
'protectedpagewarning' => '<strong>WARNING: This page has been locked so that only users with sysop privileges can edit it.</strong>',
'semiprotectedpagewarning' => "'''Note:''' This page has been locked so that only registered users can edit it.",
-'cascadeprotectedwarning' => "'''Warning:''' This page has been locked so that only users with sysop privileges can edit it, because it is included in the following cascade-protected {{PLURAL:$1|page|pages}}:
-$2",
+'cascadeprotectedwarning' => "'''Warning:''' This page has been locked so that only users with sysop privileges can edit it, because it is included in the following cascade-protected {{PLURAL:$1|page|pages}}:",
'titleprotectedwarning' => '<strong>WARNING: This page has been locked so that only some users can create it.</strong>',
'templatesused' => 'Templates used on this page:',
'templatesusedpreview' => 'Templates used in this preview:',